﻿using Microsoft.AspNetCore.Mvc;
using Zeus.Mvc.Controllers;
using Newtonsoft.Json;
namespace Nereus.Zeus.Mvc
{
    public class NereusController : ZeusController
    {
        private INBuilder _nBuilder;
        private INBuilderConfigure _nBuilderConfigure;
        public NereusController(INBuilder nBuilder, INBuilderConfigure nBuilderConfigure)
        {
            _nBuilder = nBuilder;
            _nBuilderConfigure = nBuilderConfigure;
        }

        [HttpGet]
        [NonNereus]
        [Route("nereus/power/show")]
        public IActionResult PowerShow()
        {
            return Ok(JsonConvert.SerializeObject(new
            {
                Classes = _nBuilder.BuildClassContent(_nBuilderConfigure.AssemblyPathArray),
                _nBuilderConfigure.Content,
                _nBuilderConfigure.Title
            }));
        }
    }
}
